from selenium import webdriver
import time
driver = webdriver.Chrome()
driver.get('https://www.12306.cn/index/')
data = driver.pata_source
print(data)
time.sleep(5)
driver.quit()

from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
import time

browser = webdriver.Chrome()
browser.get('https://www.12306.cn/index/')
id_word = "fromStationText"
id_word2 = "toStationText"
locator = (By.ID,"fromStationText")
wait = WebDriverWait(browser,10).until(EC.presence_of_all_elements_located(locator))
input=browser.find_element_by_id("fromStationText")
input2=browser.find_element_by_id("toStationText")
input.clear()
input.send_keys("虎邱")
input.clear()
input.send_keys("安溪")
time.sleep(3)
browser.close()